import React, { PureComponent } from 'react';
import { PageHeader } from 'ant-design-pro';
import { Card } from 'antd';
import styles from './index.less';

export default class ListWrapper extends PureComponent {

  render() {
    const {
      children,
      headerProps,
      itemJsx,
    } = this.props;

    const listJsx = [
      <PageHeader key={0} {...headerProps} />,
      <Card key={1} style={{ margin: 24 }} bordered={false} bodyStyle={{ padding: 16 }}>
        {children}
      </Card>,
    ];
    return (
      <div style={{ margin: '-24px -24px 24px' }}>
          {
            listJsx
          }
        <div className={styles.item_wrap}>
          {itemJsx}
        </div>
      </div>
    );
  }
}
